package evaluation;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Properties;

public class DefaultLayerEvaluator implements LayerEvaluator {
	private int n;
	
	@Override
	public Map<String, Double> evaluate(List<Integer> labelList, List<Integer> kList) {
		List<Integer> predictList = new ArrayList<Integer>(kList.size());
		for(int k : kList) {
			int predict;
			if(k >= n) {
				predict = 1;
			} else {
				predict = 0;
			}
			predictList.add(predict);
		}
		
		return EvaluationTool.evaluate(labelList, predictList);
	}

	@Override
	public void initialize(Properties properties) {
		n = Integer.parseInt(properties.getProperty("n_layer"));
	}

}
